﻿/*
 参考：http://keleyi.com/a/bjac/0899dpgi.htm
 */
using System;
using Keleyi.KFrame.KData.KSqlClient;
using Keleyi.KFrame.KData.KSqlTool;

namespace TestWeb.KUser
{
    public partial class UserAdd : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnAdd_Click(object sender, EventArgs e)
        {
            //添加用户的sql语句
            string m_sql = "insert into kws_test (kusername,kpassword)values("
                + SqlStringHelper.DealQuote(tbUsername.Text) + ","
                + SqlStringHelper.DealQuote(tbPassword.Text) + ")";
            
            string m_connectionString = @"server=(local);user id=sa;password=keleyi.com;database=keleyiwebsite;";

            if (SqlOperator.ExecuteNonQuery(m_connectionString, System.Data.CommandType.Text, m_sql, null) == 1)
                ltlTips.Text = "添加成功！";
            else
                ltlTips.Text = "添加失败！";
        }
    }
}